<!DOCTYPE html>
<html lang="en">
  <head>
    <title>SessionConfiguration Struct Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
  </head>
  <body>
    <a name="//apple_ref/swift/Struct/SessionConfiguration" class="dashAnchor"></a>
    <a title="SessionConfiguration Struct Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html"> Docs</a> (83% documented)</p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html"> Reference</a>
        <img id="carat" src="../img/carat.png" />
        SessionConfiguration Struct Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
          <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/AJAXObjectDriver.html">AJAXObjectDriver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Bytes.html">Bytes</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/CURL.html">CURL</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes.html#/s:C10PerfectLib6Cookie">Cookie</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Dir.html">Dir</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Encoding.html">Encoding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/FastCGIServer.html">FastCGIServer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/File.html">File</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/HTTPServer.html">HTTPServer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ICU.html">ICU</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/JSONArrayType.html">JSONArrayType</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/JSONDecode.html">JSONDecode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/JSONDictionaryType.html">JSONDictionaryType</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/JSONEncode.html">JSONEncode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/JSONNull.html">JSONNull</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes.html#/s:C10PerfectLib10LogManager">LogManager</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MimeReader.html">MimeReader</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheEvaluationContext.html">MoustacheEvaluationContext</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheEvaluationOutputCollector.html">MoustacheEvaluationOutputCollector</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheGroupTag.html">MoustacheGroupTag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheParser.html">MoustacheParser</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustachePartialTag.html">MoustachePartialTag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustachePragmaTag.html">MoustachePragmaTag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheTag.html">MoustacheTag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MoustacheTemplate.html">MoustacheTemplate</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/NetNamedPipe.html">NetNamedPipe</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/NetTCP.html">NetTCP</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/NetTCPSSL.html">NetTCPSSL</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PageHandlerRegistry.html">PageHandlerRegistry</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PerfectObject.html">PerfectObject</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PerfectObjectHandler.html">PerfectObjectHandler</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PerfectServer.html">PerfectServer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SQLite.html">SQLite</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SQLiteStmt.html">SQLiteStmt</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SessionManager.html">SessionManager</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SysProcess.html">SysProcess</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/UTF16Encoding.html">UTF16Encoding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/UTF8Encoding.html">UTF8Encoding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/WebRequest.html">WebRequest</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/WebResponse.html">WebResponse</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Global Variables.html">Global Variables</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Global Variables.html#/s:v10PerfectLib17PERFECT_LIBRARIESSS">PERFECT_LIBRARIES</a>
              </li>
              <li class="nav-group-task">
                <a href="../Global Variables.html#/s:v10PerfectLib10SQLITE_DBSSS">SQLITE_DBS</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Enums.html">Enums</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/HandlerAction.html">HandlerAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/JSONError.html">JSONError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MoustacheError.html">MoustacheError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/PerfectError.html">PerfectError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/SQLiteError.html">SQLiteError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/SessionResult.html">SessionResult</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/Closeable.html">Closeable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/HandlerAction.html">HandlerAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/PerfectObjectDriver.html">PerfectObjectDriver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/UnicodeScalar.html">UnicodeScalar</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Functions.html#/s:F10PerfectLib10FileStderrFT_CS_4File">FileStderr()</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:F10PerfectLib9FileStdinFT_CS_4File">FileStdin()</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:F10PerfectLib10FileStdoutFT_CS_4File">FileStdout()</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:F10PerfectLib10empty_uuidFT_TVSs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">empty_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:F10PerfectLib11random_uuidFT_TVSs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">random_uuid()</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/Closeable.html">Closeable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/PageHandler.html">PageHandler</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/PerfectObjectDriver.html">PerfectObjectDriver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/WebConnection.html">WebConnection</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
          <a href="../Structs.html">Structs</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/GenerateFromPointer.html">GenerateFromPointer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/SessionConfiguration.html">SessionConfiguration</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs.html#/s:V10PerfectLib20SocketFileDescriptor">SocketFileDescriptor</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>SessionConfiguration</h1>
              <div class="declaration">
                <div class="Swift">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">SessionConfiguration</span></code></pre>

                </div>
              </div>
            <p>This struct is used for configuring the various options available for a session
- seealso <code>SessionManager</code></p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FV10PerfectLib20SessionConfigurationcFMS0_FTSS7expiresSi9useCookieSb7useLinkSb7useAutoSb7useNoneSb2idSS6domainSS4pathSS13cookieExpiresSd6rotateSb6secureSb8httpOnlySb_S0_"></a>
                    <a name="//apple_ref/swift/Method/init(_:expires:useCookie:useLink:useAuto:useNone:id:domain:path:cookieExpires:rotate:secure:httpOnly:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FV10PerfectLib20SessionConfigurationcFMS0_FTSS7expiresSi9useCookieSb7useLinkSb7useAutoSb7useNoneSb2idSS6domainSS4pathSS13cookieExpiresSd6rotateSb6secureSb8httpOnlySb_S0_">init(_:expires:useCookie:useLink:useAuto:useNone:id:domain:path:cookieExpires:rotate:secure:httpOnly:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a new SessionConfiguration struct
- parameter name: The name for the new session. All session names must be unique for a given request. Attempting to initialize the same session twice will cause an exception.
- parameter expires: The number of minutes from the last access after which the session will expire.
- parameter useCookie: If true, indicates that the session should propagate by setting a browser cookie.
- parameter useLink: If true, indicates that the session should propagate by rewriting all resulting page links so that they include a search parameter.
- parameter useAuto: If true, the session begins by using both cookies and link rewriting. If the session manager detects that cookies are being properly passed then it will stop rewriting links.
- parameter useNone: If true, neither cookies nor link rewriting will be utilized. This makes session propagation the responsibility of the page handler.
- parameter id: If specified, this will be the value used to identify this session. Session ids are automatically generated when not explicitly provided.
- parameter domain: When using cookies for session proagation, this optional value will indicate the cookie&rsquo;s <code>domain</code> value. By default no domain value is set for the session cookie.
- parameter path: When using cookies for session proagation, this optional value will indicate the cookie&rsquo;s <code>path</code> value. By default no path value is set for the session cookie.
- parameter cookieExpires: When specified this value will be used as the expiration date for the session&rsquo;s cookie. When not specified, the cookie will have the same expiration as that of the session itself.
- parameter rotate: If true, the session will have a new unique session id generated for it on each request.
- parameter secure: If true, the session cookie will be marked as <code>secure</code> when it is set. This prevents the session from propagating on non-SSL requests.
- parameter httpOnly: If true, the session cookie will only be set on normal HTTP requests. This means the cookie will not be set on requests which come through the XMLHTTPRequest mechanism.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="Swift">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">expires</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">15</span><span class="p">,</span> <span class="nv">useCookie</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">useLink</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
				<span class="nv">useAuto</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">useNone</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">""</span><span class="p">,</span> <span class="nv">domain</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">""</span><span class="p">,</span> <span class="nv">path</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"/"</span><span class="p">,</span>
				<span class="nv">cookieExpires</span><span class="p">:</span> <span class="kt">Double</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">,</span> <span class="nv">rotate</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">secure</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span> <span class="nv">httpOnly</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The name for the new session. All session names must be unique for a given request. Attempting to initialize the same session twice will cause an exception.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>expires</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of minutes from the last access after which the session will expire.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>useCookie</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, indicates that the session should propagate by setting a browser cookie.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>useLink</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, indicates that the session should propagate by rewriting all resulting page links so that they include a search parameter.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>useAuto</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, the session begins by using both cookies and link rewriting. If the session manager detects that cookies are being properly passed then it will stop rewriting links.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>useNone</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, neither cookies nor link rewriting will be utilized. This makes session propagation the responsibility of the page handler.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>id</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If specified, this will be the value used to identify this session. Session ids are automatically generated when not explicitly provided.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>domain</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>When using cookies for session proagation, this optional value will indicate the cookie&rsquo;s <code>domain</code> value. By default no domain value is set for the session cookie.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>path</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>When using cookies for session proagation, this optional value will indicate the cookie&rsquo;s <code>path</code> value. By default no path value is set for the session cookie.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>cookieExpires</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>When specified this value will be used as the expiration date for the session&rsquo;s cookie. When not specified, the cookie will have the same expiration as that of the session itself.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>rotate</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, the session will have a new unique session id generated for it on each request.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>secure</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, the session cookie will be marked as <code>secure</code> when it is set. This prevents the session from propagating on non-SSL requests.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>httpOnly</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>If true, the session cookie will only be set on normal HTTP requests. This means the cookie will not be set on requests which come through the XMLHTTPRequest mechanism.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FV10PerfectLib20SessionConfigurationcFMS0_FTSS2idSS8copyFromS0__S0_"></a>
                    <a name="//apple_ref/swift/Method/init(_:id:copyFrom:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FV10PerfectLib20SessionConfigurationcFMS0_FTSS2idSS8copyFromS0__S0_">init(_:id:copyFrom:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a new SessionConfiguration struct
- parameter name: The name for the new session. All session names must be unique for a given request. Attempting to initialize the same session twice will cause an exception.
- parameter id: This will be the value used to identify this session.
- parameter copyFrom: Copy all other configuration values from the given <code>SessionConfiguration</code> struct.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="Swift">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">id</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">copyFrom</span><span class="p">:</span> <span class="kt">SessionConfiguration</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The name for the new session. All session names must be unique for a given request. Attempting to initialize the same session twice will cause an exception.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>id</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>This will be the value used to identify this session.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>copyFrom</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Copy all other configuration values from the given <code>SessionConfiguration</code> struct.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2015 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2015-11-04)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.3.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
